package Demo;

import java.io.File;

public class java2 {
	public static void main(String[] args) {
		File file=new File("a");
		delete(file);
	}

	private static void delete(File file) {
		if(file.isDirectory()){
			File[] listFiles = file.listFiles();
			if(listFiles!=null){
				for (File file2 : listFiles) {
					delete(file2);
				}
			}
		}
		file.delete();
	}
}